Working With Movie User Data
Each movie, track, and media can contain a user data list, which your application can use in any way you want. A user data list contains all the user data for a movie, track, or media. Each user data list may contain one or more user data items. All QuickTime user data items share several attributes.First, each user data item carries a type identifier. This type is similar to a Resource Manager resource type, and is stored in a long integer. Apple has reserved all lowercase user data type values. You are free to create user data type values using uppercase letters. Apple recommends using type values that begin with the © character (Option-G) to specify user data items that store text data.
The following user data types are currently defined:
User data items of these types must contain text data only.
Second, the Movie Toolbox allows you to create more than one user data item in a user data list. Therefore, each user data item is identified by a unique index. Index values are assigned sequentially within a user data type and start at 1.
Finally, you may create alternate text for a given user data text item. For example, you may want to support multiple languages and may therefore want to create different text for each language. The Movie Toolbox allows you to specify different versions of the text of a single user data item. These versions are distinguished by their region code values.
The Movie Toolbox provides a number of functions that allow you to work with user data. Before you can work with the contents of a user data list, you must obtain a reference to the list. The
GetMovieUserData
,GetTrackUserData
, orGetMediaUserData
functions allow you to get a reference to a user data list. You can then use theGetUserData
,AddUserData
, andRemoveUserData
functions to work with the items contained in the user data list. If your user data items contain text data, you can use theAddUserDataText
,GetUserDataText
, andRemoveUserDataText
functions to work with the text of a user data item. Note that a single user data item can store either text or other data, but not both.You can count the number of user data items of a specified type in a movie, track, or media by calling the
CountUserDataType
function. You can use theGetNextUserDataType
function to scan all the types of user data in a specified user data list.The Movie Toolbox also supplies a number of functions for the manipulation of user data. The
SetUserDataItem
andGetUserDataItem
functions allow easy access to data stored in user data items. TheNewUserData
andDisposeUserData
functions provide for the use of user data outside of the immediate context of QuickTime movies. Your applications and components can also create user data structures. ThePutUserDataIntoHandle
and theNewUserDataFromHandle
functions permit user data to be stored and retrieved in a manner similar to public movies (also called atoms). See the chapter "Movie Resource Formats" in this book for details on atoms.
Subtopics
- GetMovieUserData
- GetTrackUserData
- GetMediaUserData
- GetNextUserDataType
- CountUserDataType
- AddUserData
- GetUserData
- RemoveUserData
- AddUserDataText
- GetUserDataText
- RemoveUserDataText
- SetUserDataItem
- GetUserDataItem
- NewUserData
- DisposeUserData
- PutUserDataIntoHandle
- NewUserDataFromHandle